/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.msk.wlhy.mapper;


import com.msk.sys.mapper.CrudDao;
import com.msk.wlhy.domain.HtLogisticsFrame;
import com.msk.wlhy.domain.HtTransportDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>[]</p>
 * <p>作者：zkp</p>
 * <p>邮箱：zkp@xiangyou.com</p>
 * <p>创建时间： 2018-06-08 </p>
 * <p>类说明：运输单明细管理DAO接口 </p>
 * <p>修改记录：</p>
 */
@Repository
public interface HtTransportDetailDao extends CrudDao<HtTransportDetail> {
    public Long findCount(HtTransportDetail htTransportDetail);

    public void realDelete(HtTransportDetail htTransportDetail);

    /**
     * 根据司机id获取对应的未打卡的运输单明细数据
     * @param htTransportDetail
     * @return List<HtTransportDetail>
     * @throws
     */
    public List<HtTransportDetail> getTransportDetailByDriverId(HtTransportDetail htTransportDetail);

    /**
     * 校验运输单明细对应的运输单是否已经全部打卡完成
     * @param transportListId
     * @return Map<String, Object>
     * @throws
     */
    public Map<String, Object> checkTransportListIsFinish(String transportListId);

    /**
     * 根据运输单明细查找对应的订单id，当订单还处于执行中时继续往下执行，如果订单已经完成就不需要继续执行了
     * @param transportDetailId
     * @return Map<String, Object>
     * @throws
     */
    public Map<String, Object> getOrderInfoBytransportDetailId(String transportDetailId);

    /**
     * 根据订单id反查订单下所有订单明细对应的运输单的状态，当订单明细对应的所有运输单都反馈完成时需要修改订单为已完成
     * @param orderId
     * @return Map<String, Object>
     * @throws
     */
    public Map<String, Object> checkOrderIsFinish(String orderId);

    /**
     * 获取未接单的运单信息
     * @description findTransportDetailByDriverId
     * @date 2018-7-18
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<HtTransportDetail> findTransportDetailByDriverId(HtTransportDetail htTransportDetail);


    /**
     * 获取当前司机已经完成的所有运单
     * @description findComplateDetailList
     * @date 2018-7-23
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<Map<String, Object>> findComplateDetailList(HtTransportDetail htTransportDetail);

    /**
     * 获取当前司机已经完成的所有运单
     * @description findComplateDetailList
     * @date 2018-7-23
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public HtTransportDetail findComplateDetailCount(@Param("htTransportDetail") HtTransportDetail htTransportDetail,
                                                     @Param("status") String status,
                                                     @Param("startDate") String startDate,
                                                     @Param("endDate") String endDate);

    //司机评价
    public List<Map<String, Object>> findComplateDriverList(HtTransportDetail htTransportDetail);

    //货主评价
    public List<HtTransportDetail> findComplateMemberList(HtTransportDetail htTransportDetail);

    /**
     * @description updateDelFlag
     * @date 2018-8-2
     * @author chuming
     * @param htTransportDetail
     */
    public void updateDelFlag(HtTransportDetail htTransportDetail);

    /**
     * 获取运单量
     * @description selectWaybillDetailCountGroupbyMonth
     * @date 2018-8-9
     * @author chuming
     * @param xs1  运单量系数
     * @param xs2 运费系数
     * @param xs3 货物量系数
     * @return
     */
    public List<Map<String, Object>> selectWaybillDetailCountGroupbyMonth(Integer xs1, Integer xs2, Integer xs3);

    /**
     * 获取各个部门订单详情的名次
     * @description getOrderNounByType
     * @date 2018-8-9
     * @author chuming
     * @return
     */
    public List<Map<String, Object>> getOrderNounByType();

    /**
     * @description selectWaybillDetailCountGroupbyDay
     * @date 2018-10-23
     * @author chuming
     * @param xs1
     * @param xs2
     * @param xs3
     * @return
     */
    public List<Map<String, Object>> selectWaybillDetailCountGroupbyDay(Integer xs1, Integer xs2, Integer xs3);

    /**
     * @description findAllLinesFormOrder
     * @date 2018-10-24
     * @author chuming
     * @return
     */
    public List<Map<String, Object>> findAllLinesFormOrder();

    /**
     * @description findAllAuditList
     * @date 2018-10-25
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<HtTransportDetail> findAllAuditList(HtTransportDetail htTransportDetail);

    /**
     * @description findOrderNumberByOfficeAndDay
     * @date 2018-10-25
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<Map<String, Object>> findOrderNumberByOfficeAndDay(HtTransportDetail htTransportDetail);

    /**
     * @description findAllOrderNumberByDay
     * @date 2018-10-25
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<Map<String, Object>> findAllOrderNumberByDay(HtTransportDetail htTransportDetail);

    /**
     * @description findOrderLinesGroupByOffice
     * @date 2018-10-26
     * @author chuming
     * @param htTransportDetail
     * @return
     */
    public List<Map<String, Object>> findOrderLinesGroupByOffice(HtTransportDetail htTransportDetail);

    /**
     * @description updateData
     * @date 2018-10-26
     * @author chuming
     * @return
     */
    public int updateData(HtTransportDetail htTransportDetail);

    /**
     * @description getTransport
     * @date 2018-10-26
     * @author chuming
     * @return
     */
    public HtTransportDetail getTransport(String id);

    /**
     * @description getTransport
     * @date 2018-10-26
     * @author chuming
     *
     * @return
     */
    public List<Map<String, Object>> getBill(String id);

    /**
     * @description getDetailId
     * @date 2018-10-26
     * @author chuming
     *
     * @return
     */
    public Map<String, String> getDetailId(String id);

    /**
     * @description getTransport
     * @date 2018-10-26
     * @author chuming
     *
     * @return
     */
    public List<HtTransportDetail> findDetailList(HtTransportDetail htTransportDetail);

    public HtTransportDetail findDataforPrint(HtTransportDetail htTransportDetail);

    /**
     * @description findListCount
     * @date 2018-10-26
     * @author chuming
     *
     * @return List
     */
    public List<HtTransportDetail> findListCount(HtTransportDetail htTransportDetail);

    public List<Map<String, Object>> selectWaybillRevenueList(@Param("htTransportDetail") HtTransportDetail htTransportDetail,
                                                              @Param("status") String status,
                                                              @Param("startDate") String startDate,
                                                              @Param("endDate") String endDate);

    public HtTransportDetail showDetailById(HtTransportDetail htTransportDetail);

    HtLogisticsFrame findFrameContract(String orderDetailId);

    public List<HtTransportDetail> findStatisticalList(HtTransportDetail htTransportDetail);

    void uploadInsuranceFile(HtTransportDetail htTransportDetail);

    public void uploadInvoiceOrReceipt(HtTransportDetail htTransportDetail);

    public HtTransportDetail getAllFreightPrice(HtTransportDetail htTransportDetail);

    public List<HtTransportDetail> getHtTransportDetailCount(String[] ids);

    public HtTransportDetail selectDetailsById(HtTransportDetail htTransportDetail);

    /**
     * @author llh
     * @date 2023/6/20
     * @return java.util.List<com.msk.wlhy.domain.HtTransportDetail>
     * @description 货主查询在途运单列表
     */
    public List<Map<String, Object>> findGoodsWayBillList(HtTransportDetail htTransportDetail);

    /**
     * @author llh
     * @date 2023/6/20
     * @return com.msk.wlhy.domain.HtTransportDetail
     * @description 获取货主在途运单详情
     */
    public HtTransportDetail getGoodsWayBillInfo(String id);

    public List<Map<String, Object>> ofCarrierRevenuesCount(@Param("supplierUser") String supplierUser,
                                                            @Param("status") String status,
                                                            @Param("startDate") String startDate,
                                                            @Param("endDate") String endDate);

    public List<Map<String, Object>> listOfCarrierRevenues(@Param("supplierUser") String supplierUser,
                                                           @Param("status") String status,
                                                           @Param("startDate") String startDate,
                                                           @Param("endDate") String endDate);

    public Map<String, Object> getLngAndLatInfo(String shippingNoteNumber);

    Map<String, Object> selectHtTransportDetail(HtTransportDetail htTransportDetail);

    /**
     * @author llh
     * @date 2023/7/13
     * @return int
     * @description 更新SDK行程状态
     */
    public int updateItinerary(HtTransportDetail htTransportDetail);
}